package com.travel.controller;

import com.qianfeng.util.ResultMsg;
import com.travel.service.HomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/home")
public class FontHomeController {


    @Autowired
    HomeService homeService;

    /**
     * 按照酒店id查找所有房间
     * */
    @GetMapping("/getAllByHotelId")
    public ResultMsg getAllByHotelId(int hotelId){
        return homeService.getAllByHotelId(hotelId);
    }

    /**
     * 按照房间id查找单个房间
     * */
    @GetMapping("/getByHomeid")
    public ResultMsg getByHomeid(int homeId){
        return homeService.getByHomeid(homeId);
    }

    /**
     * 按照酒店id和房间类型查找单个房间
     * */
    @GetMapping("/getAllByHotelIdHomeType")
    public ResultMsg getAllByHotelid(int hotelId,String homeType){
        return homeService.getAllByHotelid(hotelId,homeType);
    }

    /**
     * 按照房间类型查找房间信息
     * */
    @GetMapping("/getAllByHomeType")
    public ResultMsg getAllByHotelType(String homeType){
        return homeService.getAllByHotelType(homeType);
    }

}
